Comment: NeoEE Patch Setup Project
[DEFINE REGION: Check Application Requirements]
label: Language Settings
Set Variable LANGUAGE to English
Set Variable LanguageChoice to English
Set Variable GameFound to TRUE
Display Dialog: language, wait for dialog to return (modal)
if Variable LanguageChoice Equals English
  Set Variable LANGUAGE to English
end
if Variable LanguageChoice Equals Deutsch
  Set Variable LANGUAGE to GERMAN
end
if Variable LanguageChoice Equals Espa�ol
  Set Variable LANGUAGE to SPANISH
end
if Variable LanguageChoice Equals Fran�ais
  Set Variable LANGUAGE to FRENCH
end
Read Registry Key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion into WindowsVersion
Get System Setting Windows 8 into Win8Check
if Variable Win8Check Equals FALSE
  Get System Setting Windows 8.1 into Win8Check
  if Variable Win8Check Equals FALSE
    Get System Setting Windows 8.1 Update 1 into Win8Check
  end
end
Read Registry Key HKLM\SOFTWARE\NeoEE Patch\EECDirectory\ into TARGETDIR
Does File Exist $TARGETDIR$\Data\data.ssa (get result into variable EECExist)
if Variable EECExist Equals FALSE
  Read Registry Key HKCU\Software\SSSI\Empire Earth\Installed From Volume into EECDrive
  Read Registry Key HKCU\Software\SSSI\Empire Earth\Installed From Directory into EECDir
  Set Persistent Variable TARGETDIR to $EECDrive$$EECDir$
else
  Set Persistent Variable TARGETDIR to $TARGETDIR$
end
Does File Exist $TARGETDIR$\Data\data.ssa (get result into variable EECExist)
Read Registry Key HKCU\SOFTWARE\NeoEE Patch\AOCCDirectory into TARGETDIRAOC
Does File Exist $TARGETDIRAOC$\Data\data.ssa (get result into variable AOCExist)
if Variable AOCExist Equals FALSE
  Read Registry Key HKCU\Software\Mad Doc Software\EE-AOC\Installed From Volume into AOCDrive
  Read Registry Key HKCU\Software\Mad Doc Software\EE-AOC\Installed From Directory into AOCDir
  Set Variable TARGETDIRAOC to $AOCDrive$$AOCDir$
end
Does File Exist $TARGETDIRAOC$\Data\data.ssa (get result into variable AOCExist)
if Variable AOCExist Equals FALSE
  Read Registry Key HKCU\Software\Neo\Art of Conquest\Installed From Directory into AOCDir
  Read Registry Key HKCU\Software\Neo\Art of Conquest\Installed From Volume into AOCDrive
  Set Persistent Variable TARGETDIRAOC to $AOCDrive$$AOCDir$
end
Does File Exist $TARGETDIRAOC$\Data\data.ssa (get result into variable AOCExist)
if Variable AOCExist Equals FALSE
  Does File Exist C:\Sierra\Empire Earth - The Art of Conquest\Data\data.ssa (get result into variable AOCExist)
  if Variable AOCExist Equals FALSE
    Does File Exist C:\Sierra\EE-ZDE\Data\data.ssa (get result into variable AOCExist)
    if Variable AOCExist Equals FALSE
      Does File Exist C:\Sierra\EE-AOC\Data\data.ssa (get result into variable AOCExist)
      if Variable AOCExist Equals FALSE
        Does File Exist C:\Program Files (x86)\Sierra\Empire Earth Gold\The Art of Conquest\Data\data.ssa (get result into variable AOCExist)
        if Variable AOCExist Equals FALSE
          Does File Exist C:\Program Files\Sierra\Empire Earth Gold\The Art of Conquest\Data\data.ssa (get result into variable AOCExist)
          if Variable AOCExist Equals FALSE
            Does File Exist C:\Program Files (x86)\GOG.com\Empire Earth Gold Edition\Empire Earth - The Art of Conquest\Data\data.ssa (get result into variable AOCExist)
            if Variable AOCExist Equals FALSE
              Does File Exist C:\Program Files\GOG.com\Empire Earth Gold Edition\Empire Earth - The Art of Conquest\Data\data.ssa (get result into variable AOCExist)
              if Variable AOCExist Equals FALSE
                Set Variable TARGETDIRAOC to 
                Set Variable AOCExist to FALSE
              else
                Set Persistent Variable TARGETDIRAOC to C:\Program Files\GOG.com\Empire Earth Gold Edition\Empire Earth - The Art of Conquest\
              end
            else
              Set Persistent Variable TARGETDIRAOC to C:\Program Files (x86)\GOG.com\Empire Earth Gold Edition\Empire Earth - The Art of Conquest\
            end
          else
            Set Persistent Variable TARGETDIRAOC to C:\Program Files\Sierra\Empire Earth Gold\The Art of Conquest\
          end
        else
          Set Persistent Variable TARGETDIRAOC to C:\Program Files (x86)\Sierra\Empire Earth Gold\The Art of Conquest\
        end
      else
        Set Persistent Variable TARGETDIRAOC to C:\Sierra\EE-AOC\
      end
    else
      Set Persistent Variable TARGETDIRAOC to C:\Sierra\EE-ZDE\
    end
  else
    Set Persistent Variable TARGETDIRAOC to C:\Sierra\Empire Earth - The Art of Conquest\
  end
end
if Variable EECExist Equals FALSE
  Does File Exist C:\Sierra\Empire Earth\Data\data.ssa (get result into variable EECExist)
  if Variable EECExist Equals FALSE
    Does File Exist D:\Sierra\Empire Earth\Data\data.ssa (get result into variable EECExist)
    if Variable EECExist Equals FALSE
      Does File Exist E:\Sierra\Empire Earth\Data\data.ssa (get result into variable EECExist)
      if Variable EECExist Equals FALSE
        Read Registry Key HKLM\SOFTWARE\Sierra OnLine\Setup\EEARTH\Directory into TARGETDIR
        Does File Exist $TARGETDIR$\Data\data.ssa (get result into variable EECExist)
        if Variable EECExist Equals FALSE
          Read Registry Key HKCU\Software\Neo\Empire Earth\Installed From Directory into EECDir
          Read Registry Key HKCU\Software\Neo\Empire Earth\Installed From Volume into EECDrive
          Set Persistent Variable TARGETDIR to $EECDrive$$EECDir$
          Does File Exist $TARGETDIR$\Data\data.ssa (get result into variable EECExist)
          if Variable EECExist Equals FALSE
            Does File Exist C:\Program Files (x86)\Sierra\Empire Earth Gold\Empire Earth\Data\data.ssa (get result into variable EECExist)
            if Variable EECExist Equals FALSE
              Does File Exist C:\Program Files\Sierra\Empire Earth Gold\Empire Earth\Data\data.ssa (get result into variable EECExist)
              if Variable EECExist Equals FALSE
                Does File Exist C:\Program Files\GOG.com\Empire Earth Gold Edition\Empire Earth\Data\data.ssa (get result into variable EECExist)
                if Variable EECExist Equals FALSE
                  Does File Exist C:\Program Files (x86)\GOG.com\Empire Earth Gold Edition\Empire Earth\Data\data.ssa (get result into variable EECExist)
                  if Variable EECExist Equals FALSE
                    Set Variable TARGETDIR to 
                    Set Variable GameFound to False
                  else
                    Set Persistent Variable TARGETDIR to C:\Program Files (x86)\GOG.com\Empire Earth Gold Edition\Empire Earth\
                  end
                else
                  Set Persistent Variable TARGETDIR to C:\Program Files\GOG.com\Empire Earth Gold Edition\Empire Earth\
                end
              else
                Set Persistent Variable TARGETDIR to C:\Program Files\Sierra\Empire Earth Gold\Empire Earth\
              end
            else
              Set Persistent Variable TARGETDIR to C:\Program Files (x86)\Sierra\Empire Earth Gold\Empire Earth\
            end
          end
        end
      else
        Set Persistent Variable TARGETDIR to E:\Sierra\Empire Earth\
      end
    else
      Set Persistent Variable TARGETDIR to D:\Sierra\Empire Earth\
    end
  else
    Set Persistent Variable TARGETDIR to C:\Sierra\Empire Earth\
  end
end
Set Variable PatchPhrase to Patch: None
Set Variable OldEEVersion to Version : 1.0.0.0
Set Variable OldAOCVersion to Version : 1.0.0.0
Set Variable PatchPhraseAOC to Patch: None
Set Variable NotFoundAOCPhrase to 
Set Variable NotFoundEEPhrase to 
Does File Exist $TARGETDIR$\readme.1.0.4.0.txt (get result into variable EECVersion104)
if Variable EECVersion104 Equals TRUE
  Set Variable OldEEVersion to Version : 1.0.0.4
end
Does File Exist $TARGETDIR$\readme_DSML_AddOn.txt (get result into variable EECVersion200)
if Variable EECVersion200 Equals TRUE
  Set Variable OldEEVersion to Version : 2.0.0.0
end
Does File Exist $TARGETDIR$\RC 2.2 Version.JPG (get result into variable EECRCVersion)
if Variable EECRCVersion Equals TRUE
  Set Variable PatchPhrase to Patch: RC
  Set Variable OldEEVersion to Version : 1.0.0.4
end
Does File Exist $TARGETDIR$\NeoEE.txt (get result into variable EECNeoVersion)
if Variable EECNeoVersion Equals TRUE
  Set Variable PatchPhrase to "NeoEE" Mod
  Does File Exist $TARGETDIR$\_wonkver.pub (get result into variable EECNeoVersion2004)
  Copy Local Files $TARGETDIR$\zzWONVersion.cfg to $TARGETDIR$\NeoEECache.ki
  if Variable EECNeoVersion2004 Equals TRUE
    Set Variable OldEEVersion to Version : 2.0.0.4
  end
end
Does File Exist $TARGETDIRAOC$\NeoEE.txt (get result into variable AOCNeoVersion)
if Variable AOCNeoVersion Equals TRUE
  Set Variable PatchPhraseAOC to "NeoEE" Mod
  Copy Local Files $TARGETDIRAOC$\zzWONVersion.cfg to $TARGETDIRAOC$\NeoEECache.ki
  Set Variable OldAOCVersion to Version : 1.0.0.1
end
if Variable AOCExist Equals FALSE
  Set Variable NotFoundAOCPhrase to Game Not Found
  Set Variable PatchPhraseAOC to 
  Set Variable OldAOCVersion to 
end
label: ReadMe Information
if Variable EECExist Equals FALSE
  Set Variable NotFoundEEPhrase to Game Not Found
  Set Variable PatchPhrase to 
  Set Variable OldEEVersion to 
end
[END REGION]
[DEFINE REGION: Readme]
Display Dialog: readme, wait for dialog to return (modal)
label: Setup Type
Set Variable alreadycdkey to 
Set Variable newcdkey to 
Set Variable skipcdkey to 
Set Variable ENGLISH to 
Set Variable SPANISH to 
Set Variable CHINEASE to 
Set Persistent Variable ip_connection to titan.neoee.net
if Variable WIZARDReadMe Equals CANCEL
  Terminate Installation
end
Set Variable RUSSIAN to 
Set Variable customneoee to 
Set Variable autoneoee to 
Set Variable KOREAN to 
Set Variable POLISH to 
Set Variable FRENCH to 
Set Variable GERMAN to 
Set Variable REPAIRCDKEY to FALSE
Set Variable AOC_Tick to FALSE
Set Variable REPAIR to FALSE
Set Variable autoneoee to TRUE
Set Variable ITALIAN to 
Set Variable key_status to 
Set Variable key_statusaoc to 
Set Variable cdfinish to 
Set Variable cdfinishaoc to 
Set Variable ITALIANAOC to 
Set Variable GERMANAOC to 
Set Variable ENGLISHAOC to 
Set Variable SPANISHAOC to 
Set Variable FRENCHAOC to 
[DEFINE REGION: Define Setup Globals]
Comment: Define Setup Components
Define Component: Chinease
Define Component: English
Define Component: Spanish
Define Component: French
Define Component: German
Define Component: Italian
Define Component: Russian
Define Component: Korean
Define Component: Polish
[END REGION]
Display Dialog: setuptype, wait for dialog to return (modal)
if Variable WIZARDSetupType Equals NEXT
  if Variable ENGLISH not Equals TRUE
    if Variable SPANISH not Equals TRUE
      if Variable GERMAN not Equals TRUE
        if Variable ITALIAN not Equals TRUE
          if Variable FRENCH not Equals TRUE
            if Variable CHINEASE not Equals TRUE
              if Variable RUSSIAN not Equals TRUE
                if Variable KOREAN not Equals TRUE
                  if Variable POLISH not Equals TRUE
                    MessageBox: Language, Please Choose Language for your Empire Earth
                    GoTo Label: Setup Type
                  end
                end
              end
            end
          end
        end
      end
    end
  end
end
Comment: TO-DO: Customize your minimum setup here
Set Variable MYFOLDER to $TARGETDIRAOC$
if Variable ENGLISH Equals TRUE
  Select Component: English
  Deselect Component: Chinease
  Deselect Component: German
  Deselect Component: French
  Deselect Component: Chinease
  Deselect Component: Spanish
  Deselect Component: Italian
  Deselect Component: POLish
  Deselect Component: RUSSIAN
  Deselect Component: KOREAN
  Set Persistent Variable ENGLISH to TRUE
else
  if Variable FRENCH Equals TRUE
    Deselect Component: English
    Deselect Component: German
    Select Component: French
    Deselect Component: Chinease
    Deselect Component: Spanish
    Deselect Component: Italian
    Deselect Component: POLish
    Deselect Component: RUSSIAN
    Deselect Component: KOREAN
    Set Persistent Variable FRENCH to TRUE
  else
    if Variable SPANISH Equals TRUE
      Deselect Component: English
      Deselect Component: German
      Deselect Component: French
      Select Component: Spanish
      Deselect Component: POLish
      Deselect Component: RUSSIAN
      Deselect Component: KOREAN
      Deselect Component: Chinease
      Deselect Component: Italian
      Set Persistent Variable SPANISH to TRUE
    else
      if Variable GERMAN Equals TRUE
        Deselect Component: English
        Select Component: German
        Deselect Component: Chinease
        Deselect Component: French
        Deselect Component: Spanish
        Deselect Component: Italian
        Deselect Component: POLish
        Deselect Component: RUSSIAN
        Deselect Component: KOREAN
        Set Persistent Variable GERMAN to TRUE
      else
        if Variable ITALIAN Equals TRUE
          Deselect Component: English
          Deselect Component: German
          Deselect Component: Chinease
          Deselect Component: French
          Deselect Component: Spanish
          Select Component: Italian
          Deselect Component: POLish
          Deselect Component: RUSSIAN
          Deselect Component: KOREAN
          Set Persistent Variable ITALIAN to TRUE
        else
          if Variable CHINEASE Equals TRUE
            Deselect Component: English
            Deselect Component: German
            Select Component: Chinease
            Deselect Component: French
            Deselect Component: Spanish
            Deselect Component: POLish
            Deselect Component: RUSSIAN
            Deselect Component: KOREAN
            Deselect Component: Italian
            Set Persistent Variable CHINEASE to TRUE
          else
            if Variable RUSSIAN Equals TRUE
              Deselect Component: English
              Deselect Component: German
              Deselect Component: Chinease
              Deselect Component: French
              Deselect Component: Spanish
              Deselect Component: POLish
              Select Component: RUSSIAN
              Deselect Component: KOREAN
              Deselect Component: Italian
              Set Persistent Variable RUSSIAN to TRUE
            else
              if Variable KOREAN Equals TRUE
                Deselect Component: English
                Deselect Component: German
                Deselect Component: Chinease
                Deselect Component: French
                Deselect Component: Spanish
                Deselect Component: Italian
                Deselect Component: POLish
                Deselect Component: RUSSIAN
                Select Component: KOREAN
                Set Persistent Variable KOREAN to TRUE
              else
                if Variable POLISH Equals TRUE
                  Deselect Component: English
                  Deselect Component: German
                  Deselect Component: Chinease
                  Deselect Component: French
                  Deselect Component: Spanish
                  Select Component: POLISH
                  Deselect Component: RUSSIAN
                  Deselect Component: KOREAN
                  Deselect Component: Italian
                  Set Persistent Variable POLISH to TRUE
                end
              end
            end
          end
        end
      end
    end
  end
end
if Variable WIZARDSetupType Equals BACK
  GoTo Label: ReadMe Information
end
if Variable WIZARDSetupType Equals CANCEL
  Terminate Installation
end
label: Component Tree
Display Dialog: componentstree, wait for dialog to return (modal)
if Variable WIZARDTREE Equals BACK
  GoTo Label: Setup Type
end
if Variable WIZARDTREE Equals CANCEL
  Terminate Installation
end
if Variable customneoee Equals TRUE
  GoTo Label: Custom Directories
end
if Variable autoneoee Equals TRUE
  GoTo Label: Start Installation
end
label: Custom Directories
Display Dialog: destination, wait for dialog to return (modal)
if Variable WIZARDDestination Equals BACK
  GoTo Label: Component Tree
end
if Variable WIZARDDestination Equals CANCEL
  Terminate Installation
end
if Variable WIZARDDestination Equals NEXT
  Does File Exist $TARGETDIR$\Data\data.ssa (get result into variable EECExist)
  if Variable EECExist Equals FALSE
    MessageBox: Empire Earth Directory, Please Select Your Empire Earth Directory ... (Select Your Empire Earth Folder)
    GoTo Label: Custom Directories
  end
end
if Variable AOC_Tick Equals TRUE
  label: AOC
  Display Dialog: registration, wait for dialog to return (modal)
  if Variable WIZARDAOC Equals CANCEL
    Terminate Installation
  end
  if Variable WIZARDAOC Equals BACK
    GoTo Label: Custom Directories
  end
  if Variable WIZARDAOC Equals NEXT
    Does File Exist $MYFOLDER$\Data\data.ssa (get result into variable AOCExist)
    if Variable AOCExist Equals FALSE
      MessageBox: Art of Conquest Directory, Please Select Your AOC Directory ... (Select Your art of Conquest Folder)
      GoTo Label: AOC
    else
      Set Variable TARGETDIRAOC to $MYFOLDER$
      GoTo Label: Start Installation
    end
  end
end
Comment: Display Dialog: progressprereq, wait for dialog to return (modal)
[END REGION]
label: Start Installation
[DEFINE REGION: Installation]
Comment: Prepare to install
Get Folder Location System->Desktop Directory into DESKTOPDIR
Get Folder Location System->Windows Directory into WINDIR
Get Folder Location System->System Directory into WINSYSDIR
Get Folder Location Taskbar->Quick Launch Directory into QUICKLAUNCHDIR
Get Folder Location WWW->WWWRoot into WWWROOTDIR
Set Variable PROGRESSTEXT to Installing $TITLE$
Set Variable LASTERROR to 
Set Variable SUCCESS to 
Set Variable DESKTOPDIR to 
if Variable AOCExist Equals TRUE
  if Variable AOC_Tick Equals TRUE
    Set Persistent Variable AOC_Tick to TRUE
    Create Shortcut $DESKTOPDIR$\NeoEE AOC to $TARGETDIRAOC$\EE-AOC.exe
  end
end
Create Shortcut $DESKTOPDIR$\Neo Empire Earth to $TARGETDIR$\Empire Earth.exe
Display Dialog: progress, use as progress dialog (non-modal)
if Variable PatchPhrase Equals Patch : "RC"
  Delete Files $TARGETDIR$\RC 2.2 Version.JPG (when installing)
end
[compiler if Variable BUILDMODE not Equals patch]
Does File Exist $TARGETDIRAOC$\Data\data.ssa (get result into variable AOCExist)
if Variable AOCExist Equals TRUE
  if Variable AOC_Tick Equals TRUE
    Copy Local Files $TARGETDIRAOC$\WONLobby.cfg to $TARGETDIRAOC$\TempWONLobby.cfg
    Read from Text File $TARGETDIRAOC$\TempWONLobby.cfg into Variable languageaoc_y
    if Variable $languageaoc_y$ Equals Language: DE
      Set Variable GERMANAOC to TRUE
    else
      if Variable $languageaoc_y$ Equals Language: IT
        Set Variable ITALIANAOC to TRUE
      else
        if Variable $languageaoc_y$ Equals Language: ES
          Set Variable SPANISHAOC to TRUE
        else
          if Variable $languageaoc_y$ Equals Language: FR
            Set Variable FRENCHAOC to TRUE
          else
            Set Variable ENGLISHAOC to TRUE
          end
        end
      end
    end
    Parse String $languageaoc_y$ into Variables languageaoc_final and  (Split at first occurrence of pattern)
  end
  Safely Terminate Process "EE-AOC.exe", get result into variable 
  Delete Files $TARGETDIRAOC$\Data\db\*.* (when installing)
  Delete Files $TARGETDIRAOC$\Data\textures\*.* (when installing)
  Delete Files $TARGETDIRAOC$\Data\Models\*.* (when installing)
  Delete Files $TARGETDIRAOC$\Data\WONLobby Resources\Skin\*.* (when installing)
  Delete Files $TARGETDIRAOC$\Sierra Update\*.* (when installing)
  Delete Files $TARGETDIRAOC$\Sierra Update\SierraUpRes\*.* (when installing)
  Delete Registry VALUE HKCU\Software\Neo\Art of Conquest\Installed From Volume
  Delete Registry VALUE HKCU\Software\Neo\Art of Conquest\Installed From Directory
  Delete Files $TARGETDIRAOC$\DX7HRTnLDisplay.dll (when installing)
  Delete Files $TARGETDIRAOC$\TCP Protocol.dll (when installing)
  Delete Files $TARGETDIRAOC$\DX7HRDisplay.dll (when installing)
  Delete Files $TARGETDIRAOC$\Mss32.dll (when installing)
  Delete Files $TARGETDIRAOC$\Default.dll (when installing)
  Delete Files $TARGETDIRAOC$\Low-Level Engine.dll (when installing)
  Delete Files $TARGETDIRAOC$\EE-AOC.exe (when installing)
  Delete Files $TARGETDIRAOC$\binkw32.dll (when installing)
  Delete Files $TARGETDIRAOC$\Miles Sound System Mixer.dll (when installing)
  Delete Files $TARGETDIRAOC$\sxlrt233.dll (when installing)
  Delete Files $TARGETDIRAOC$\_wonkver.pub (when installing)
  Delete Files $TARGETDIRAOC$\NeoEE Updater\NeoEEUp.cfg (when installing)
  Delete Files $TARGETDIRAOC$\Sierra Update\SierraUpRes\*.* (when installing)
  Delete Files $TARGETDIRAOC$\Sierra Update\*.* (when installing)
  Install Files D:\EE Server\EE Patch\Patch Files\AOC\NeoEE Updater\NeoEEUp.cfg to $TARGETDIRAOC$\NeoEE Updater (Permanent), include subfolders
  Install Files D:\EE Server\EE Patch\Patch Files\Common Files\_wonkver.pub to $TARGETDIRAOC$ (Permanent), include subfolders
  Install Files D:\EE Server\EE Patch\Patch Files\AOC\NeoEE Updater\NeoEEUp.exe to $TARGETDIRAOC$\NeoEE Updater (Permanent), include subfolders
  Install Files D:\EE Server\EE Patch\Patch Files\AOC\game.ico to $TARGETDIRAOC$ (Permanent), include subfolders
  Install Files D:\EE Server\EE Patch\Patch Files\AOC\gfw_high.ico to $TARGETDIRAOC$ (Permanent), include subfolders
  Install Files D:\EE Server\EE Patch\Patch Files\AOC\db\dbworld.dat to $TARGETDIRAOC$\Data\db (Permanent)
  Install Files D:\EE Server\EE Patch\Patch Files\AOC\db\dbuicontrols.dat to $TARGETDIRAOC$\Data\db (Permanent)
  Install Files D:\EE Server\EE Patch\Patch Files\AOC\model\amb_rock.cem to $TARGETDIRAOC$\Data\Models (Permanent), include subfolders
  Install Files D:\EE Server\EE Patch\Patch Files\AOC\*.* to $TARGETDIRAOC$ (Permanent)
  Install Files D:\EE Server\EE Patch\Patch Files\AOC\Skin\*.* to $TARGETDIRAOC$\Data\WONLobby Resources\Skin (Permanent), include subfolders
  Write Registry Key HKLM\SOFTWARE\NeoEE Patch\AOCDirectory, $TARGETDIRAOC$ (permanent)
  if Variable Win8Check Equals TRUE
    Write Registry Key HKCU\Software\Neo\Art of Conquest\Game Bit Depth, 32 (permanent)
    Write Registry Key HKLM\Software\Neo\Art of Conquest\Rasterizer Name, Direct3D (permanent)
  end
  if Variable WindowsVersion Equals 6.2
    Write Registry Key HKCU\Software\Neo\Art of Conquest\Game Bit Depth, 32 (permanent)
    Write Registry Key HKLM\Software\Neo\Art of Conquest\Rasterizer Name, Direct3D (permanent)
  end
  if Variable WindowsVersion Equals 6.3
    Write Registry Key HKCU\Software\Neo\Art of Conquest\Game Bit Depth, 32 (permanent)
    Write Registry Key HKLM\Software\Neo\Art of Conquest\Rasterizer Name, Direct3D (permanent)
  end
  if Variable WindowsVersion Equals 10.0
    Write Registry Key HKCU\Software\Neo\Art of Conquest\Game Bit Depth, 32 (permanent)
    Write Registry Key HKLM\Software\Neo\Art of Conquest\Rasterizer Name, Direct3D (permanent)
  end
  if Variable SPANISHAOC not Equals TRUE
    if Variable ITALIANAOC not Equals TRUE
      if Variable FRENCHAOC not Equals TRUE
        if Variable GERMANAOC not Equals TRUE
          if Variable ENGLISHAOC not Equals TRUE
            Set Variable ENGLISHAOC to TRUE
          end
        end
      end
    end
  end
  if Variable ENGLISHAOC Equals TRUE
    Delete Files $TARGETDIRAOC$\WONLobby.cfg (when installing)
    Install Files D:\EE Server\EE Patch\Patch Files\AOC\EN\WONLobby.cfg to $TARGETDIRAOC$\ (Permanent), include subfolders
    Write Registry Key HKLM\SOFTWARE\NeoEE Patch\Lang, ENGLISH (permanent)
  else
    if Variable SPANISHAOC Equals TRUE
      Delete Files $TARGETDIRAOC$\WONLobby.cfg (when installing)
      Install Files D:\EE Server\EE Patch\Patch Files\AOC\SP\WONLobby.cfg to $TARGETDIRAOC$\ (Permanent), include subfolders
      Write Registry Key HKLM\SOFTWARE\NeoEE Patch\Lang, SPANISH (permanent)
    else
      if Variable FRENCHAOC Equals TRUE
        Delete Files $TARGETDIRAOC$\WONLobby.cfg (when installing)
        Install Files D:\EE Server\EE Patch\Patch Files\AOC\FR\WONLobby.cfg to $TARGETDIRAOC$\ (Permanent), include subfolders
        Write Registry Key HKLM\SOFTWARE\NeoEE Patch\Lang, FRENCH (permanent)
      else
        if Variable ITALIANAOC Equals TRUE
          Delete Files $TARGETDIRAOC$\WONLobby.cfg (when installing)
          Install Files D:\EE Server\EE Patch\Patch Files\AOC\IT\WONLobby.cfg to $TARGETDIRAOC$\ (Permanent), include subfolders
          Write Registry Key HKLM\SOFTWARE\NeoEE Patch\Lang, ITALIAN (permanent)
        else
          if Variable GERMANAOC Equals TRUE
            Delete Files $TARGETDIRAOC$\WONLobby.cfg (when installing)
            Install Files D:\EE Server\EE Patch\Patch Files\AOC\DE\WONLobby.cfg to $TARGETDIRAOC$\ (Permanent), include subfolders
            Write Registry Key HKLM\SOFTWARE\NeoEE Patch\Lang, GERMAN (permanent)
            Delete Files $TARGETDIRAOC$\Data\WONLobby Resources\_LobbyResource.cfg (when installing)
            Install Files D:\EE Server\EE Patch\Patch Files\AOC\DE Language Chat fix\Data\WONLobby Resources\_LobbyResource.cfg to $TARGETDIRAOC$\Data\WONLobby Resources (Permanent), include subfolders
          end
        end
      end
    end
  end
end
Apply Install (get result into variable SUCCESS)
Set Variable PROGRESS to 100
[compiler end]
Hide Dialog
Display Dialog: finish, wait for dialog to return (modal)
if Variable WIZARDFin Equals Finish
  Terminate Installation
end
[END REGION]
[END REGION]
